package com.itheima.objectstream;

import com.itheima.domain.Student;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

/*
对象 -> 文件中
序列化
 */
public class Demo01 {

    public static void main(String[] args) throws IOException {
        Student student1 = new Student("吴亦凡1", 31,"海淀监狱");
        Student student2 = new Student("吴亦凡2", 32,"海淀监狱");
        Student student3 = new Student("吴亦凡3", 33,"海淀监狱");

        //创建输出流
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("day13\\aaa\\student.txt"));
        oos.writeObject(student1);
        oos.writeObject(student2);
        oos.writeObject(student3);
        oos.close();


    }
}
